package com.micronaut.cloud.manager;

import com.micronaut.cloud.model.entity.UserInfo;
import com.micronaut.cloud.repository.UserInfoRepository;
import com.micronaut.cloud.service.UserInfoService;
import io.micronaut.context.event.ApplicationEventPublisher;
import jakarta.inject.Inject;
import jakarta.inject.Singleton;
import lombok.RequiredArgsConstructor;

import java.util.Optional;

@Singleton
public class UserInfoManager implements UserInfoService {
    @Inject
    private UserInfoRepository userInfoRepository;

    @Override
    public UserInfo findById(Long id) {
        Optional<UserInfo> userInfoOptional = userInfoRepository.findById(id);
        return userInfoOptional.orElse(null);
    }
}
